package com.superlistaportable.productList;

import android.view.View;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.ImageButton;

import com.example.superlistaportable.R;

public class ProductListView  extends View {
	private final ProductListActivity activity;
	private final ProductListModel model;
    ExpandableListAdapter listAdapter;
    ExpandableListView expListView;
    
	public ProductListView(ProductListActivity activity, ProductListModel model) {
		super(activity, null);
		
		this.activity = activity;
		this.model = model;
		activity.setContentView(R.layout.product_list);
        buildExpandableList();
	}

	public void buildExpandableList() {
		expListView = (ExpandableListView) this.activity.findViewById(R.id.lvExp);
        listAdapter = new ExpandableListAdapter(this.activity, this.model);
        expListView.setAdapter(listAdapter);
	}

	public ExpandableListView getExpandableList() {
		return expListView;
	}

	public Button getAddItemButton() {
		return (Button) activity.findViewById(R.id.addItem);
	}
	
	public Button getRemoveItemButton() {
		return (Button) activity.findViewById(R.id.removeItem);
	}
	
	public ImageButton getButtonReload() {
		return (ImageButton) activity.findViewById(R.id.buttonReload);
	}
	
	public Button getButtonNext() {
		return (Button) activity.findViewById(R.id.buttonNext);
	}

	public Button getButtonSales() {
		return (Button) activity.findViewById(R.id.buttonGoToSales);
	}
	
}
